import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/home',
        name: 'Home',
        component: () => import('@/views/Home.vue'),
        children: [
            {
                path: "/",
                component:()=> import('@/views/WelCome')
            },{
                path: '/category',
                name: 'Category',
                component: () => import('@/views/commodity/Category.vue'),

            },{
                path: '/commodity',
                name: 'Commodity',
                component: () => import('@/views/commodity/Commodity.vue'),

            },{
                path: '/order',
                name: 'Order',
                component: () => import('@/views/commodity/Order.vue'),

            },
            {
                path: '/aftermarket',
                name: 'Aftermarket',
                component: () => import('@/views/commodity/Aftermarket.vue'),

            },
            {
                path: '/freight',
                name: 'Freight',
                component: () => import('@/views/commodity/Freight.vue'),

            },

        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
